package com.hg.junit.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/my")
public class MyController {

    @RequestMapping(value = "/test", produces = "text/plain;charset=UTF-8", method = RequestMethod.GET)
    public String getString() {
        return "Hello World!";
    }

    @GetMapping(value = "/girls")
    public Integer girlList() {
        return 100;
    }

    @GetMapping(value = "/map")
    public Map<String, String> map() {
        Map<String, String> map = new HashMap<>();
        map.put("score", "40");
        map.put("name", "kobe");
        return map;
    }
}
